package com.godme.es.bean;


import lombok.Data;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;


@Data
@ToString
@Entity
// 取消驼峰转下划线，默认table名称为Position，需要手动指定
@Table(name = "position")
public class Position {

//    @org.springframework.data.annotation.Id
    @Id
    private Long id;

    private String companyName;

    private String positionAdvantage;

    // boolean在lombok中生成方法不是getXXX，而是isXXX，规范写法boolean不能isXXX
    private boolean forward;
    private boolean schoolJob;


    private Timestamp generateTime;
    private Timestamp bornTime;
    private Timestamp offlineTime;
    private Timestamp adviceTime;
    private Timestamp verifyTime;
    private Timestamp adStartTime;
    private Timestamp adEndTime;
    private Timestamp weightStartTime;
    private Timestamp weightEndTime;
    private Timestamp prolong_offline_time;

    private Long companyId;
    private Long salaryMin;
    private Long salaryMax;
    private Long salaryMonth;
    private Long isEnable;
    private Long isIndex;
    private Long orderby;
    private Long isAdvice;
    private Long showorder;
    private Long publishUserId;
    private Long isReward;
    private Long isExpired;
    private Long positionDetailPV;
    private Long positionDetailPV_cnbeta;
    private Long receivedResumeCount;
    private Long refuseResumeCount;
    private Long markCanInterviewCount;
    private Long haveNoticeInterCount;
    private Long isForbidden;
    private Long adWord;
    private Long adTimes;
    private Long adBeforeDetailPV;
    private Long adAfterDetailPV;
    private Long adBeforeReceivedCount;
    private Long adAfterReceivedCount;
    private Long adjustScore;

    private String positionName;
    private String salary;
    private String education;
    private String workYear;
    private String jobNature;
    private String chargeField;
    private Timestamp createTime;
    private String email;
    private String publishTime;
    private String city;
    private String workAddress;
    private String rewardMoney;
    private String comeFrom;
    private String reason;
    private String adRankAndTime;
    private String forwardEmail;
    private boolean type;

    public ESPosition toESPosition(){
        ESPosition esPosition = new ESPosition();
        BeanUtils.copyProperties(this, esPosition);
        return esPosition;
    }

}
